chore(deploy): auto-deploy gittensory-api via Workers Builds (migrate + deploy) - #633
Conversation
… (migrate + deploy) gittensory-api (the backend worker) had no automated deploy — only gittensory-ui auto-deploys via Cloudflare Workers Builds — so backend merges piled up unshipped (a 71-commit/5-day backlog incl. the earn-CTA footer). Make deploy:api the canonical backend deploy that applies pending D1 migrations then deploys, so a Workers Builds connection (deploy command: npm run deploy:api) keeps schema + code in sync on every push. wrangler d1 migrations apply is non-interactive in CI and only applies PENDING migrations (no-op when none). Document the per-worker Workers Builds setup + build-watch-paths in CONTRIBUTING.
|
Note Gittensory Gate skippedPR closed before full evaluation. No late first comment was created.
💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →. Checked by Gittensory, a quiet PR intelligence layer for OSS maintainers. |
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
gittensory-ui | a348bbd | Commit Preview URL Branch Preview URL |
Jun 12 2026, 07:40 PM |
ghost
left a comment
There was a problem hiding this comment.
Gittensory review · advisory — a maintainer merges
0 actionable · 2 nitpick(s) · 2 file(s) · two independent AI reviewers
Suggested action: ✅ Safe to merge — both reviewers found no blocking issues.
📋 Walkthrough
The PR modifies package.json to run remote D1 migrations before deploying the API worker, and updates CONTRIBUTING.md to reflect the new automatic deployment workflow and watch‑path recommendations.
Changes
| File | Summary |
|---|---|
package.json |
Changed deploy:api script to run wrangler d1 migrations apply gittensory --remote before wrangler deploy. |
CONTRIBUTING.md |
Rewrote deployment section to describe automatic deployments for both workers, added details on the new deploy:api command and watch‑path configuration. |
🔍 Reviewer notes
Reviewer A · gpt-oss-120b — recommends ✅ merge
This PR updates the deployment script to apply pending D1 migrations before deploying the API worker and expands the CONTRIBUTING guide to document the new automatic deployment process.
Suggestions
- Add a comment in the script or docs noting that
wrangler d1 migrations applymust be non‑interactive and only apply pending migrations to avoid accidental schema changes. - Consider adding a CI step that verifies the
deploy:apiscript runs without error in a dry‑run mode to catch credential or migration issues early.
Worth double-checking
- Remote migrations running on every CI deploy could cause race conditions if multiple builds deploy concurrently.
- If credentials for remote D1 access are misconfigured, the deployment could fail or partially apply migrations.
Reviewer B · nemotron-3-120b-a12b — recommends ✅ merge
The PR updates the API deploy script to run D1 migrations before deployment and clarifies Cloudflare Workers Builds usage in CONTRIBUTING.md. Changes are limited to package.json scripts and documentation, with no code or behavior changes. The migration step is safe (non-interactive, pending-only) and documentation improvements are helpful.
Worth double-checking
- Ensure migration scripts are backward-compatible and testable locally (though existing db:migrate scripts cover this).
- Verify that wrangler d1 migrations apply --remote is non-interactive in CI (standard behavior).
🤖 Automated advisory review · a maintainer makes the final call.
ghost
left a comment
There was a problem hiding this comment.
Gittensory review · advisory — a maintainer merges
0 actionable · 2 nitpick(s) · 2 file(s) · two independent AI reviewers
Suggested action: ✅ Safe to merge — both reviewers found no blocking issues.
📋 Walkthrough
The PR modifies the deploy:api npm script to run pending D1 migrations on the remote database before deploying the Cloudflare worker, and updates CONTRIBUTING.md to describe the new automatic deployment workflow for both API and UI workers.
Changes
| File | Summary |
|---|---|
package.json |
Changed deploy:api script to run remote D1 migrations before wrangler deploy. |
CONTRIBUTING.md |
Updated deployment documentation to reflect automatic deployments for both workers and added details on the new deploy:api command and watch-paths. |
🔍 Reviewer notes
Reviewer A · gpt-oss-120b — recommends ✅ merge
This PR updates the deployment script to run pending D1 migrations before deploying the API worker and expands the CONTRIBUTING guide to document the new automatic deployment process. The changes are limited to scripts and documentation, with no code impact.
Suggestions
- Add a note in the CI workflow to fail fast if
wrangler d1 migrations applyreturns an error, ensuring a broken migration stops the deploy. - Consider adding a brief comment in
package.jsonexplaining why the remote migration step is needed for future maintainers.
Worth double-checking
- Automatic remote migrations could apply unintended schema changes if a migration is added without proper review.
- If a migration fails, the deploy will also fail; ensure CI reports this clearly.
Reviewer B · nemotron-3-120b-a12b — recommends ✅ merge
This PR automates deployment of the gittensory-api worker by updating the deploy:api script to run pending D1 migrations before wrangler deploy, and updates CONTRIBUTING.md to document the new Cloudflare Workers Builds setup for both API and UI workers. The change is safe, improves deployment reliability, and maintains the public/private boundary as it only affects internal deployment processes.
No blocking issues spotted.
🤖 Automated advisory review · a maintainer makes the final call.
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
What
Make
gittensory-api(the backend worker) auto-deployable, likegittensory-uialready is.deploy:apinow applies pending D1 migrations then deploys:wrangler d1 migrations apply gittensory --remote && wrangler deploy.wrangler d1 migrations applyis non-interactive in CI and only applies PENDING migrations (no-op when none), so schema + code stay in sync on every build.Why
gittensory-apihad no automated deploy — only the UI auto-deploys via Cloudflare Workers Builds — so backend merges piled up unshipped (a 71-commit / 5-day backlog, including the earn-CTA footer #620, sat stale in prod).Follow-up (dashboard, not in this PR)
After merge: add a Workers Builds connection for
gittensory-api(deploy commandnpm run deploy:api, build-watch-paths per CONTRIBUTING), and scope the existinggittensory-uibuild's watch-paths so the two don't rebuild each other.